package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class EC implements Serializable {

	private static final long serialVersionUID = -4405905274913723213L;
	
	private int numEC;
	private String libelle;
	private float coef;
	private UE ue;
	private Collection<Creneau> listeCreneaux;
	private Collection<JNTTypeECEnseignant> listeServices;
	private Collection<JNTTypeEC> listeHeuresTheoriques;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public EC() {}

	public EC(int numEC, String libelle, float coef, UE ue) {
		super();
		this.numEC = numEC;
		this.libelle = libelle;
		this.coef = coef;
		this.ue = ue;
		this.listeCreneaux = null;
		this.listeHeuresTheoriques = null;
		this.listeServices = null;
	}
	

	public Collection<JNTTypeEC> getListeHeuresTheoriques() {
		return listeHeuresTheoriques;
	}

	public void setListeHeuresTheoriques(Collection<JNTTypeEC> listeHeuresTheoriques) {
		this.listeHeuresTheoriques = listeHeuresTheoriques;
	}

	public Collection<JNTTypeECEnseignant> getListeServices() {
		return listeServices;
	}

	public void setListeServices(Collection<JNTTypeECEnseignant> listeServices) {
		this.listeServices = listeServices;
	}

	public Collection<Creneau> getListeCreneau() {
		return listeCreneaux;
	}

	public void setListeCreneau(Collection<Creneau> listeCreneau) {
		this.listeCreneaux = listeCreneau;
	}

	public UE getUe() {
		return ue;
	}

	public void setUe(UE ue) {
		this.ue = ue;
	}
	
	public int getNumEC() {
		return numEC;
	}
	
	public void setNumEC(int numEC) {
		this.numEC = numEC;
	}
	
	public String getLibelle() {
		return libelle;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
	
	public float getCoef() {
		return coef;
	}
	
	public void setCoef(float coef) {
		this.coef = coef;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
